<template>
	<view>
		<view class="sqSearch hasFlex" :class="[hasBack ?'hasMargL' : '']" :style="{width:hasBack ? (searchWid- 50) + 'px' : searchWid + 'px'}" @tap="goSearch">
			<view class="innerSearch spaceBet alignCen" :style="{height:(navHeightSm-10) + 'px'}">
				<view class="hasFlex alignCen" style="height: 100%;">
					<view class="line"></view>
					<text>{{searchTxt}}</text> 
				</view>
				<view class="iconfont icon-sq-search"></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			searchTxt:String,
			hasBack:Boolean,
			searchType:String
		},
		data(){
			return{
				navHeightSm:getApp().globalData.navigationBarHeight,
				searchWid:getApp().globalData.menuBarLeft,
			}
		},
		methods:{
			goSearch(){
				uni.navigateTo({
					url:'/pages/subSqIndex/search/search?searchType=' + this.searchType
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import '@/static/scss/sqSearch.scss';
</style>